﻿// ***********************************************************************
// Assembly         : WebBrowser
// Author           : Fredrik
// Created          : 07-31-2013
//
// Last Modified By : Fredrik
// Last Modified On : 08-02-2013
// ***********************************************************************
// <copyright file="MyViewModel.cs" company="">
//     Copyright (c) . All rights reserved.
// </copyright>
// <summary></summary>
// ***********************************************************************
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Text;
using System.Reflection;
using System.Diagnostics;
using Windows.Storage;
using Windows.Storage.Streams;
using WinRtUtility;
using System.IO;
using System.Runtime.Serialization;
using System.Threading.Tasks;
using Windows.Foundation.Collections;
using System.Collections.Specialized;
using Roaming;
namespace App1
{
    /// <summary>
    /// Class Favorite
    /// </summary>
    public class Favorite : RoamingObservableDictionary
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Favorite"/> class.
        /// </summary>
        public Favorite()
        {

        }
        /// <summary>
        /// Gets or sets the URL.
        /// </summary>
        /// <value>The URL.</value>
        public string Url { get { return Get("Url"); } set { Set("Url", value); } }
        /// <summary>
        /// Gets or sets the Body.
        /// </summary>
        /// <value>The body.</value>
        public string Body { get { return Get("Body"); } set { Set("Body", value); } }
    }

    /// <summary>
    /// Class MyViewModel
    /// </summary>
    public class MyViewModel : ObservableDictionary<string, object>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="MyViewModel"/> class.
        /// </summary>
        public MyViewModel()
        {
            Favorites = new RoamingObservableCollection<Favorite>();
            Favorites.Container = ApplicationData.Current.RoamingSettings.CreateContainer("Favorites", ApplicationDataCreateDisposition.Always);
            NewPage = new Favorite();
            NewPage.Container = ApplicationData.Current.RoamingSettings.CreateContainer("NewPage", ApplicationDataCreateDisposition.Always);
        }
        /// <summary>
        /// Gets or sets the new page.
        /// </summary>
        /// <value>The new page.</value>
        public Favorite NewPage
        {
            get
            {
                return (Favorite)this["NewPage"];
            }
            set
            {
                this["NewPage"] = value;
            }
        }

        /// <summary>
        /// Gets the favorites.
        /// </summary>
        /// <value>The favorites.</value>
        public RoamingObservableCollection<Favorite> Favorites
        {
            get
            {
                return (RoamingObservableCollection<Favorite>)this["Favorites"];
            }
            private set
            {
                this["Favorites"] = value;
            }
        }
    }


}
